<template>
  <div class="aui-card-list">
  <uni-list-query-card :queryShow="queryShow" @query-click="getDataList()" @click="(e)=>{this.queryShow=e}" @searchReset="searchReset()">
      <el-col :span="6">
        <el-form-item :label="$t('bpmTaskExtUser.className')">
          <el-input v-model="dataForm.className" :placeholder="$t('bpmTaskExtUser.className')" clearable></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item :label="$t('bpmTaskExtUser.methodsName')">
          <el-input v-model="dataForm.methodsName" :placeholder="$t('bpmTaskExtUser.methodsName')" clearable></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item :label="$t('bpmTaskExtUser.defName')">
          <el-input v-model="dataForm.defType" :placeholder="$t('bpmTaskExtUser.defName')" clearable></el-input>
        </el-form-item>
      </el-col>
  </uni-list-query-card>
    <el-card shadow="never" class="aui-card-list-body">
      <vxe-toolbar :setting="{immediate:true}">
        <template v-slot:buttons>
          <el-button v-if="$hasPermission('bpm:bpmTaskExtUser:save')" type="primary" @click="addOrUpdateHandle()">
            {{ $t('add') }}
          </el-button>
          <el-button v-if="$hasPermission('bpm:bpmTaskExtUser:delete')" type="danger" @click="deleteHandle()">
            {{ $t('deleteBatch') }}
          </el-button>
        </template>
        <template v-slot:tools>
          <el-button icon="el-icon-refresh" @click="getDataList()" circle></el-button>
        </template>
      </vxe-toolbar>
      <div class="aui-card-list-body-table">
        <vxe-table :loading="dataListLoading" :data="dataList" ref="xTable" auto-resize class="vxe-table-element"
          remote-sort @sort-change="dataListSortChangeHandle" @select-change="dataListSelectionChangeHandleVex"
          @select-all="dataListSelectionAllChangeHandleVex" max-height="auto">
          <vxe-table-column type="checkbox" width="50" align="center"></vxe-table-column>
          <vxe-table-column field="defType" title="bpmTaskExtUser.defType"></vxe-table-column>
          <vxe-table-column field="defName" title="bpmTaskExtUser.defName"></vxe-table-column>
          <vxe-table-column field="className" title="bpmTaskExtUser.className"></vxe-table-column>
          <vxe-table-column field="methodsName" title="bpmTaskExtUser.methodsName"></vxe-table-column>
          <vxe-table-column title="handle" fixed="right" width="120" align="center">
            <template slot-scope="scope">
              <el-button v-if="$hasPermission('bpm:bpmTaskExtUser:update')" type="text" size="small" icon="el-icon-edit"
                @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}
              </el-button>
              <el-button v-if="$hasPermission('bpm:bpmTaskExtUser:delete')" type="text" size="small"
                icon="el-icon-delete" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}
              </el-button>
            </template>
          </vxe-table-column>
        </vxe-table>
        <el-pagination :current-page="page" :page-sizes="[10, 20, 50, 100]" :page-size="limit" :total="total"
          layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
          @current-change="pageCurrentChangeHandle">
        </el-pagination>
      </div>
        <!-- 弹窗, 新增 / 修改 -->
        <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </el-card>
  </div>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './bpmTaskExtUser-add-or-update'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/bpm/bpmTaskExtUser/page',
        getDataListIsPage: true,
        deleteURL: '/bpm/bpmTaskExtUser',
        deleteIsBatch: true,
        exportURL: '/bpm/bpmTaskExtUser/export'
      },
      dataForm: {
        className: '',
        methodsName: '',
        defName: ''
      }
    }
  },
  components: {
    AddOrUpdate
  }
}
</script>
